#pragma once

#define LOGIN 1
#define CHAT 2
#define CHATREQ 3
#define CHATRESP 4

#define FRIEND 5

#define CHATMSG 6

#include<list>
#include"data.h"
#include"user.h"

typedef struct
{
    int service_type;
    int data_len;
}HEAD;

//登录请求
typedef struct
{
    int id;
    char password[10];
}LOGIN_REQ;

//登录响应
typedef struct
{
    int id;
    int status;
}LOGIN_RESP;

//聊天请求
typedef struct{
    int send_id;
    int recv_id;
    char  msg[100];
}CHAT_REQ;

//聊天响应
typedef struct 
{
    int status;
    char msg[100];
}CHAT_RESP;


typedef struct
{
    int id;
}FRI_REQ;

//好友列表响应
typedef struct 
{
    User users[10];
    int num;
}FRI_RESP;

//消息记录协议

//消息请求
typedef struct
{

    int send_id;
    int recv_id;
}CHATMSG_REQ;

//消息响应
typedef struct
{   
    char msgs[100];
}CHATMSG_RESP;


//insert_masg
typedef struct
{
    int send_id;
    int recv_id;
    char msg[1024];
}CHATMSGINSERT_REQ;

typedef struct
{
    bool st;
    char resp_msg[100];
}CHATMSGINSERT_RESP;


